package gov.tax.rti.base.security.entity;

import gov.tax.rti.core.security.entity.UserImpl;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * 用户标识
 * 
 * @since 2013年11月6日
 * @author jimmy.li
 * @version 1.00 2013年11月6日
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "RTI_YHBS")
public class Yhbs extends UserImpl {
	
	private int yxbz;
	private Date qysj;
	private Date sxsj;
	private String yhbsSy;
	private String yhbsSx;
	private int jzmm;
	private Date mmqx;
	private String gxsz;
	private String sjbqDm;
	
	@Id
	@GeneratedValue(generator = "guid")
	@GenericGenerator(name = "guid", strategy = "guid")
	@Column(name = "YHBS_DM", unique = true, nullable = false, length = 32)
	public String getYhbsDm() {
		return super.getId();
	}
	
	public void setYhbsDm(String yhbsDm) {
		super.setId(yhbsDm);
	}
	
	/*public String getId() {
		return super.getId();
	}*/
	
	@Column(name = "YHBS_BM", nullable = false, length = 32)
	public String getYhbsBm() {
		return super.getUsername();
	}
	
	public void setYhbsBm(String yhbsBm) {
		super.setUsername(yhbsBm);
	}
	
	@Column(name = "MMXY", nullable = false, length = 512)
	public String getMmxy() {
		return super.getPassword();
	}
	
	public void setMmxy(String mmxy) {
		super.setPassword(mmxy);
	}
	
	@Column(name = "YHBS_MC", nullable = false, length = 96)
	public String getYhbsMc() {
		return super.getName();
	}
	
	public void setYhbsMc(String YhbsMc) {
		super.setName(YhbsMc);
	}

	@Column(name = "YXBZ")
	public int getYxbz() {
		return yxbz;
	}

	public void setYxbz(int yxbz) {
		this.yxbz = yxbz;
	}
	
	@Transient
	public boolean isEnabled() {
		return getYxbz() > 0;
	}
	
	@Override
	public void setUsername(String username) {
		super.setUsername(username);
	}

	@Column(name = "QYSJ")
	public Date getQysj() {
		return qysj;
	}

	public void setQysj(Date qysj) {
		this.qysj = qysj;
	}

	@Column(name = "SXSJ")
	public Date getSxsj() {
		return sxsj;
	}

	public void setSxsj(Date sxsj) {
		this.sxsj = sxsj;
	}
	@Column(name = "YHBS_SY",length = 16)
	public String getYhbsSy() {
		return yhbsSy;
	}

	public void setYhbsSy(String yhbsSy) {
		this.yhbsSy = yhbsSy;
	}

	@Column(name = "YHBS_SX",length = 8)
	public String getYhbsSx() {
		return yhbsSx;
	}

	public void setYhbsSx(String yhbsSx) {
		this.yhbsSx = yhbsSx;
	}

	@Column(name = "GXSZ",length = 4000)
	public String getGxsz() {
		return gxsz;
	}

	public void setGxsz(String gxsz) {
		this.gxsz = gxsz;
	}

	@Column(name = "JZMM")
	public int getJzmm() {
		return jzmm;
	}

	public void setJzmm(int jzmm) {
		this.jzmm = jzmm;
	}

	@Column(name = "MMQX")
	public Date getMmqx() {
		return mmqx;
	}

	public void setMmqx(Date mmqx) {
		this.mmqx = mmqx;
	}
	
	@Column(name = "SJBQ_DM")
	public String getSjbqDm() {
		return sjbqDm;
	}

	public void setSjbqDm(String sjbqDm) {
		this.sjbqDm = sjbqDm;
	}
}
